<template>
	<view class="content">
		<view class="topCon">
			<view style="height: 160rpx;">
				<image class="left" :src="userInfo.img"></image>
				<view class="right">
					<view>
						<span>{{ userInfo.xingming }}</span>
						<span>{{ userInfo.tel }}</span>
					</view>
					<view>
						<span>{{ userInfo.diqu }}</span>
						<span>{{ userInfo.shenfen }}</span>
					</view>
					<view>
						<span>{{ userInfo.gongsiming }}</span>
					</view>
				</view>
				<view class="set" @click="userInfoto">修改</view>
			</view>
			
			<image class="xuehua" src="../../static/14.png"></image>
			<view class="find-box">
				<view class="li" @click="customerCategory(0)">
					<view class="circle" style="background-color: #FFF4E8;">
						<image style="width: 50rpx;height: 50rpx;" src="../../static/15.png"></image>
					</view>
					<view class="name">客户类别</view>
				</view>
				<view class="li" @click="customerCategory(1)">
					<view class="circle" style="background-color: #E9FBF7;">
						<image src="../../static/16.png"></image>
					</view>
					<view class="name">跟进类别</view>
				</view>
				<view class="li" @click="accountBook">
					<view class="circle" style="background-color: #F2F0FF;">
						<image src="../../static/17.png"></image>
					</view>
					<view class="name">记账本</view>
				</view>
				<view class="li" @click="impressionAdministration">
					<view class="circle" style="background-color: #F2F0FF;">
						<image src="../../static/17.png"></image>
					</view>
					<view class="name">客户印象管理</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		getUser
	} from "@/utils/api.js";
	export default {
		data() {
			return {
				value: 'Hello',
				showButton: true,
				countTime: 60,
				timer: null,
				checked:true,
				userInfo:'',
			}
		},
		onLoad() {
          this.getUser()
		},
		onShow() {
			 this.getUser()
		},
		methods: {
			userInfoto(){
				uni.navigateTo({
					url:"/pages/userInfo/index"
				})
			},
			async getUser(){
				let that = this
				let data = {
					user_id:uni.getStorageSync('userInfo').user_id
				}
				let res = await getUser(data);
				console.log('个人中心',res)
				that.userInfo = res.results[0]
				
				
			},
			onCheckAllChange(e){
				console.log(e)
			},
			clearIcon: function() {
				this.inputClearValue = '';
				this.showClearIcon = false;
			},
			customerCategory(type){
				uni.navigateTo({
					url:"/pages/customerCategory/index?index="+type
				})
			},
			accountBook(){
				uni.navigateTo({
					url:"/pages/accountBook/index"
				})
			},
			impressionAdministration(){
				uni.navigateTo({
					url:"/pages/impressionAdministration/index"
				})
			},
		}
	}
</script>

<style>
	page {
		height: 100%;
	}

	.content {
		height: 100%;

	}

	.topCon {
		height: 70%;
		padding-top: 200rpx;
		position: relative;
		background-image: linear-gradient(to bottom, #4EAEE8, #C8EAFD, #fff);
	}
    .topCon .left{
		width: 100rpx;
		height: 100rpx;
		border-radius: 100rpx;
		float: left;
		margin-left: 50rpx;
		margin-top: 30rpx;
	}
	.topCon .right{
		float: left;
		margin-left: 30rpx;
		color: white;
		font-size: 26rpx;
		line-height: 54rpx;
	}
	.topCon .right view span:nth-child(2){
		margin-left: 30rpx;
	}
	.topCon .xuehua{
		width: 200rpx;
		height: 200rpx;
		position: absolute;
		right: 30rpx;
		top: 40rpx;
	}
	 .topCon .set{
		 position: absolute;
		 right: 30rpx;
		 top: 220rpx;
		 color: white;
		 font-size: 30rpx;
		 z-index: 10;
	 }
	.find-box {
		width: 87%;
		height: 460rpx;
		margin: auto;
		background-color: white;
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;
		border-radius: 10rpx;
		margin-top: 50rpx;
	
	}
	
	.find-box .li {
		width: 200rpx;
		height: 160rpx;
		text-align: center;
		margin-top: 20rpx;
		line-height: 50rpx;
		font-size: 26rpx;
	}
	.find-box .li .circle{
		width: 120rpx;
		height: 120rpx;
		border-radius: 120rpx;
		background-color: #EDF3FF;
		margin: auto;
	}
	
	.find-box .li .circle image {
		width: 70rpx;
		height: 70rpx;
		margin-top: 35rpx;
	}
</style>